<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div align="center">
		<form action="student/selectStudent">
			学生姓名（模糊查询）：<input type="text" name="stuname">
			<input type="submit" value="查询">
		</form>
		<c:if test="${empty students}">
			找不到学生！<br>
		</c:if>
		<c:if test="${!empty students}">
			<table border="1">
			 	<tr>
			 		<th>学号</th>
				 	<th>姓名</th>
				 	<th>性别</th>
				 	<th>功能</th>	
			 	</tr>
				<c:forEach var="s" items="${students }">
				 	<tr>
				 	<td>${s.stuno }</td>
				 	<td>${s.stuname }</td>
				 	<td>${s.stusex }</td>
				 	<td>
				 		<a href="student/deleteStudent?stuno=${s.stuno}">删除</a>
				 		<a href="student/updateStudent?stuname=${URLEncoder.encode(s.stuname, 'UTF-8')}">修改</a>
				 	</td>	
				 	</tr>
				</c:forEach>
		 	</table>
		</c:if>
	</div>
	
</body>
</html>